const { createProxyMiddleware } = require("http-proxy-middleware");

module.exports = function(app) {
     /**
     * 1.匹配到/api/v1,开始做代理 http:/xxx
     */
    app.use(createProxyMiddleware([process.env.REACT_APP_API], {
        target: process.env.REACT_APP_BASE_URL ,
        changeOrigin: true,
        pathRewrite: {
            [`^${process.env.REACT_APP_API}`] : "/api/v1",
        },
    })
    );
};